package com.ice.base.service.impl;


import com.ice.base.dao.ParamMapper;
import com.ice.base.service.ParamService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;

/**
 * Created by acer on 2020/2/10/0010.
 */
@Service
class ParamServiceImpl implements ParamService {
    @Autowired
    ParamMapper paramMapper;

    @Override
    public HashMap<String, Object> getParamByKey(String key) {
        return paramMapper.selectParamByKey(key);
    }

    @Override
    public String getValueByKey(String key) {
        HashMap<String,Object> paramMap = paramMapper.selectParamByKey(key);
        return paramMap.get("param_value")==null?"":paramMap.get("param_value").toString();
    }

    @Override
    public int setParamValueByKey(HashMap<String, Object> param) {
        return paramMapper.setParamValueByKey(param);
    }

/*    @Override
    public PageInfo getParamPage(HashMap<String, Object> param) {
        PageInfo pageInfo = new PageInfo();
        pageInfo.setList(paramMapper.selectParamPage(param));
        pageInfo.setPageNum(Integer.parseInt(param.get("pageNum").toString()));
        pageInfo.setPageSize(Integer.parseInt(param.get("pageSize").toString()));
        pageInfo.setTotal(paramMapper.selectParamCount(param));
        return pageInfo;
    }*/
}
